Component({
  mixins: [],
  data: {
    listData: [],
    total: 0,
    page: 1,
    pagesize: 10,
    modalVd: false,
    vdUrl: '', //预览视频
  },
  props: {},
  didMount() { 
    this.getList(1);
  },
  didUpdate() {},
  didUnmount() {},
  methods: {
    //关闭视频模态框
    closeVideo(e) {
      var name = e.currentTarget.dataset.name;
      this.setData({
        [name]: false,
        vdUrl: '',
      });
    },
    //预览视频
    openVideo(e) {
      console.log(e)
      var src = e.currentTarget.dataset.x.record.video_url;
      this.setData({
        vdUrl: src,
        modalVd: true,
      });
    },
    getPageData(current){
      this.getList(current.detail.value);
    },
    // 列表数据
    getList(pageNum) {
      var apiurl = 'App.ShopRedsVideo.GetTaskList';
      var params = {
        "page": pageNum,
        "pagesize": this.data.pagesize,
      };
      var app = getApp();
      var self = this;
      app.xdapis(apiurl, params, function (e) {
        my.hideLoading();
        console.log(e.list);
        // my.alert({ title: JSON.stringify(e) });
        self.setData({
          listData: e.list,
          total: e.page_info.total,
          page: e.page_info.page,
          pagesize: e.page_info.pagesize
        });
      });
    },
  },
});
